home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
LANG
/
C
/
LIB
/
UNIXLIB37B
/
!UnixLib37
/
src
/
c
/
strchr
< prev
next >
Wrap
Text File
|
1996-11-09
|
1KB
|
60 lines
/****************************************************************************
*
* $Source: /unixb/home/unixlib/source/unixlib37/src/c/RCS/strchr,v $
* $Date: 1996/10/30 21:58:59 $
* $Revision: 1.2 $
* $State: Rel $
* $Author: unixlib $
*
* $Log: strchr,v $
* Revision 1.2 1996/10/30 21:58:59 unixlib
* Massive changes made by Nick Burret and Peter Burwood.
*
* Revision 1.1 1996/04/19 21:26:42 simon
* Initial revision
*
***************************************************************************/
static const char rcs_id[] = "$Id: strchr,v 1.2 1996/10/30 21:58:59 unixlib Rel $";
#include <string.h>
char *
strchr (register const char *s, register int c)
{
register int i;
while ((i = *s) && (i != c))
s++;
if (i == c)
return ((char *) s);
else
return (0);
}
char *
strrchr (register const char *s, register int c)
{
register int i;
register const char *_s;
_s = 0;
do
if ((i = *s) == c)
_s = s;
while (s++, i);
return ((char *) _s);
}
char *index (const char *s, int c)
{
return strchr (s, c);
}
char *rindex (const char *s, int c)
{
return strrchr (s, c);
}